//
//  TFbackgroundImage.swift
//  TalkfunSDKDemo
//
//  Created by 莫瑞权 on 2022/4/30.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

public class TFbackgroundImage: UIView {
    @objc public let imageView = UIImageView()
    @objc public let label = UILabel()
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(self.imageView)
        
        self.label.font = UIFont.PingFang(size: 16)
        self.label.textAlignment = .center
        self.label.textColor = UIColor(red: 220/255.0, green: 224/255.0, blue: 228/255.0 , alpha: 1)
        self.addSubview(self.label)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    public override func layoutSubviews() {
        super.layoutSubviews()
        self.imageView.contentMode = .scaleAspectFit
        self.imageView.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: 84)
        
        self.label.frame = CGRect(x: 0, y: self.frame.size.height-22.5, width: self.frame.size.width, height: 22.5)
   
    }
}
